﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of a tool to measure distances.</summary>
	// Token: 0x02000048 RID: 72
	[Serializable]
	public class HMeasure : HHandle, ISerializable, ICloneable
	{
		// Token: 0x060009DE RID: 2526 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HMeasure() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x060009DF RID: 2527 RVA: 0x0003F048 File Offset: 0x0003D248
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HMeasure(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x060009E0 RID: 2528 RVA: 0x0003F057 File Offset: 0x0003D257
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HMeasure(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x060009E1 RID: 2529 RVA: 0x0003F066 File Offset: 0x0003D266
		private void AssertSemType()
		{
			base.AssertSemType("measure");
		}

		// Token: 0x060009E2 RID: 2530 RVA: 0x0003F073 File Offset: 0x0003D273
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HMeasure obj)
		{
			obj = new HMeasure(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x060009E3 RID: 2531 RVA: 0x0003F08C File Offset: 0x0003D28C
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HMeasure[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HMeasure[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HMeasure(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to an annular arc.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="centerRow">Row coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="centerCol">Column coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="radius">Radius of the arc. Default: 50.0</param>
		/// <param name="angleStart">Start angle of the arc in radians. Default: 0.0</param>
		/// <param name="angleExtent">Angular extent of the arc in radians. Default: 6.28318</param>
		/// <param name="annulusRadius">Radius (half width) of the annulus. Default: 10.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x060009E4 RID: 2532 RVA: 0x0003F0FC File Offset: 0x0003D2FC
		public HMeasure(HTuple centerRow, HTuple centerCol, HTuple radius, HTuple angleStart, HTuple angleExtent, HTuple annulusRadius, int width, int height, string interpolation)
		{
			IntPtr proc = HalconAPI.PreCall(838);
			HalconAPI.Store(proc, 0, centerRow);
			HalconAPI.Store(proc, 1, centerCol);
			HalconAPI.Store(proc, 2, radius);
			HalconAPI.Store(proc, 3, angleStart);
			HalconAPI.Store(proc, 4, angleExtent);
			HalconAPI.Store(proc, 5, annulusRadius);
			HalconAPI.StoreI(proc, 6, width);
			HalconAPI.StoreI(proc, 7, height);
			HalconAPI.StoreS(proc, 8, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(centerRow);
			HalconAPI.UnpinTuple(centerCol);
			HalconAPI.UnpinTuple(radius);
			HalconAPI.UnpinTuple(angleStart);
			HalconAPI.UnpinTuple(angleExtent);
			HalconAPI.UnpinTuple(annulusRadius);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to an annular arc.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="centerRow">Row coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="centerCol">Column coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="radius">Radius of the arc. Default: 50.0</param>
		/// <param name="angleStart">Start angle of the arc in radians. Default: 0.0</param>
		/// <param name="angleExtent">Angular extent of the arc in radians. Default: 6.28318</param>
		/// <param name="annulusRadius">Radius (half width) of the annulus. Default: 10.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x060009E5 RID: 2533 RVA: 0x0003F1B8 File Offset: 0x0003D3B8
		public HMeasure(double centerRow, double centerCol, double radius, double angleStart, double angleExtent, double annulusRadius, int width, int height, string interpolation)
		{
			IntPtr proc = HalconAPI.PreCall(838);
			HalconAPI.StoreD(proc, 0, centerRow);
			HalconAPI.StoreD(proc, 1, centerCol);
			HalconAPI.StoreD(proc, 2, radius);
			HalconAPI.StoreD(proc, 3, angleStart);
			HalconAPI.StoreD(proc, 4, angleExtent);
			HalconAPI.StoreD(proc, 5, annulusRadius);
			HalconAPI.StoreI(proc, 6, width);
			HalconAPI.StoreI(proc, 7, height);
			HalconAPI.StoreS(proc, 8, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to a rectangle.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the center of the rectangle. Default: 300.0</param>
		/// <param name="column">Column coordinate of the center of the rectangle. Default: 200.0</param>
		/// <param name="phi">Angle of longitudinal axis of the rectangle to horizontal (radians). Default: 0.0</param>
		/// <param name="length1">Half width of the rectangle. Default: 100.0</param>
		/// <param name="length2">Half height of the rectangle. Default: 20.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x060009E6 RID: 2534 RVA: 0x0003F24C File Offset: 0x0003D44C
		public HMeasure(HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, int width, int height, string interpolation)
		{
			IntPtr proc = HalconAPI.PreCall(839);
			HalconAPI.Store(proc, 0, row);
			HalconAPI.Store(proc, 1, column);
			HalconAPI.Store(proc, 2, phi);
			HalconAPI.Store(proc, 3, length1);
			HalconAPI.Store(proc, 4, length2);
			HalconAPI.StoreI(proc, 5, width);
			HalconAPI.StoreI(proc, 6, height);
			HalconAPI.StoreS(proc, 7, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HalconAPI.UnpinTuple(phi);
			HalconAPI.UnpinTuple(length1);
			HalconAPI.UnpinTuple(length2);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to a rectangle.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the center of the rectangle. Default: 300.0</param>
		/// <param name="column">Column coordinate of the center of the rectangle. Default: 200.0</param>
		/// <param name="phi">Angle of longitudinal axis of the rectangle to horizontal (radians). Default: 0.0</param>
		/// <param name="length1">Half width of the rectangle. Default: 100.0</param>
		/// <param name="length2">Half height of the rectangle. Default: 20.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x060009E7 RID: 2535 RVA: 0x0003F2F8 File Offset: 0x0003D4F8
		public HMeasure(double row, double column, double phi, double length1, double length2, int width, int height, string interpolation)
		{
			IntPtr proc = HalconAPI.PreCall(839);
			HalconAPI.StoreD(proc, 0, row);
			HalconAPI.StoreD(proc, 1, column);
			HalconAPI.StoreD(proc, 2, phi);
			HalconAPI.StoreD(proc, 3, length1);
			HalconAPI.StoreD(proc, 4, length2);
			HalconAPI.StoreI(proc, 5, width);
			HalconAPI.StoreI(proc, 6, height);
			HalconAPI.StoreS(proc, 7, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		// Token: 0x060009E8 RID: 2536 RVA: 0x0003F384 File Offset: 0x0003D584
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeMeasure();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x060009E9 RID: 2537 RVA: 0x0003F3BC File Offset: 0x0003D5BC
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HMeasure(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeMeasure(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x060009EA RID: 2538 RVA: 0x0003F3FC File Offset: 0x0003D5FC
		public new void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeMeasure();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x060009EB RID: 2539 RVA: 0x0003F410 File Offset: 0x0003D610
		public new static HMeasure Deserialize(Stream stream)
		{
			HMeasure hmeasure = new HMeasure();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hmeasure.DeserializeMeasure(hserializedItem);
			hserializedItem.Dispose();
			return hmeasure;
		}

		// Token: 0x060009EC RID: 2540 RVA: 0x0003F436 File Offset: 0x0003D636
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x060009ED RID: 2541 RVA: 0x0003F440 File Offset: 0x0003D640
		public new HMeasure Clone()
		{
			HSerializedItem hserializedItem = this.SerializeMeasure();
			HMeasure hmeasure = new HMeasure();
			hmeasure.DeserializeMeasure(hserializedItem);
			hserializedItem.Dispose();
			return hmeasure;
		}

		/// <summary>
		///   Serialize a measure object.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x060009EE RID: 2542 RVA: 0x0003F468 File Offset: 0x0003D668
		public HSerializedItem SerializeMeasure()
		{
			IntPtr proc = HalconAPI.PreCall(821);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Deserialize a serialized measure object.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x060009EF RID: 2543 RVA: 0x0003F4B0 File Offset: 0x0003D6B0
		public void DeserializeMeasure(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(822);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Write a measure object to a file.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060009F0 RID: 2544 RVA: 0x0003F504 File Offset: 0x0003D704
		public void WriteMeasure(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(823);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Read a measure object from a file.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="fileName">File name.</param>
		// Token: 0x060009F1 RID: 2545 RVA: 0x0003F540 File Offset: 0x0003D740
		public void ReadMeasure(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(824);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Extracting points with a particular gray value along a rectangle or an annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of gaussian smoothing. Default: 1.0</param>
		/// <param name="threshold">Threshold. Default: 128.0</param>
		/// <param name="select">Selection of points. Default: "all"</param>
		/// <param name="rowThresh">Row coordinates of points with threshold value.</param>
		/// <param name="columnThresh">Column coordinates of points with threshold value.</param>
		/// <param name="distance">Distance between consecutive points.</param>
		// Token: 0x060009F2 RID: 2546 RVA: 0x0003F58C File Offset: 0x0003D78C
		public void MeasureThresh(HImage image, double sigma, double threshold, string select, out HTuple rowThresh, out HTuple columnThresh, out HTuple distance)
		{
			IntPtr proc = HalconAPI.PreCall(825);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, threshold);
			HalconAPI.StoreS(proc, 3, select);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowThresh);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnThresh);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out distance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Delete a measure object.
		///   Instance represents: Measure object handle.
		/// </summary>
		// Token: 0x060009F3 RID: 2547 RVA: 0x0003F624 File Offset: 0x0003D824
		public void CloseMeasure()
		{
			IntPtr proc = HalconAPI.PreCall(827);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Extract a gray value profile perpendicular to a rectangle or annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <returns>Gray value profile.</returns>
		// Token: 0x060009F4 RID: 2548 RVA: 0x0003F658 File Offset: 0x0003D858
		public HTuple MeasureProjection(HImage image)
		{
			IntPtr proc = HalconAPI.PreCall(828);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Reset a fuzzy function.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="setType">Selection of the fuzzy set. Default: "contrast"</param>
		// Token: 0x060009F5 RID: 2549 RVA: 0x0003F6B0 File Offset: 0x0003D8B0
		public void ResetFuzzyMeasure(string setType)
		{
			IntPtr proc = HalconAPI.PreCall(829);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, setType);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Specify a normalized fuzzy function for edge pairs.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="pairSize">Favored width of edge pairs. Default: 10.0</param>
		/// <param name="setType">Selection of the fuzzy set. Default: "size_abs_diff"</param>
		/// <param name="function">Fuzzy function.</param>
		// Token: 0x060009F6 RID: 2550 RVA: 0x0003F6EC File Offset: 0x0003D8EC
		public void SetFuzzyMeasureNormPair(HTuple pairSize, string setType, HFunction1D function)
		{
			IntPtr proc = HalconAPI.PreCall(830);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, pairSize);
			HalconAPI.StoreS(proc, 2, setType);
			HalconAPI.Store(proc, 3, function);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(pairSize);
			HalconAPI.UnpinTuple(function);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Specify a normalized fuzzy function for edge pairs.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="pairSize">Favored width of edge pairs. Default: 10.0</param>
		/// <param name="setType">Selection of the fuzzy set. Default: "size_abs_diff"</param>
		/// <param name="function">Fuzzy function.</param>
		// Token: 0x060009F7 RID: 2551 RVA: 0x0003F750 File Offset: 0x0003D950
		public void SetFuzzyMeasureNormPair(double pairSize, string setType, HFunction1D function)
		{
			IntPtr proc = HalconAPI.PreCall(830);
			base.Store(proc, 0);
			HalconAPI.StoreD(proc, 1, pairSize);
			HalconAPI.StoreS(proc, 2, setType);
			HalconAPI.Store(proc, 3, function);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(function);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Specify a fuzzy function.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="setType">Selection of the fuzzy set. Default: "contrast"</param>
		/// <param name="function">Fuzzy function.</param>
		// Token: 0x060009F8 RID: 2552 RVA: 0x0003F7AC File Offset: 0x0003D9AC
		public void SetFuzzyMeasure(string setType, HFunction1D function)
		{
			IntPtr proc = HalconAPI.PreCall(831);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, setType);
			HalconAPI.Store(proc, 2, function);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(function);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Extract straight edge pairs perpendicular to a rectangle or an annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of Gaussian smoothing. Default: 1.0</param>
		/// <param name="ampThresh">Minimum edge amplitude. Default: 30.0</param>
		/// <param name="fuzzyThresh">Minimum fuzzy value. Default: 0.5</param>
		/// <param name="transition">Select the first gray value transition of the edge pairs. Default: "all"</param>
		/// <param name="pairing">Constraint of pairing. Default: "no_restriction"</param>
		/// <param name="numPairs">Number of edge pairs. Default: 10</param>
		/// <param name="rowEdgeFirst">Row coordinate of the first edge.</param>
		/// <param name="columnEdgeFirst">Column coordinate of the first edge.</param>
		/// <param name="amplitudeFirst">Edge amplitude of the first edge (with sign).</param>
		/// <param name="rowEdgeSecond">Row coordinate of the second edge.</param>
		/// <param name="columnEdgeSecond">Column coordinate of the second edge.</param>
		/// <param name="amplitudeSecond">Edge amplitude of the second edge (with sign).</param>
		/// <param name="rowPairCenter">Row coordinate of the center of the edge pair.</param>
		/// <param name="columnPairCenter">Column coordinate of the center of the edge pair.</param>
		/// <param name="fuzzyScore">Fuzzy evaluation of the edge pair.</param>
		/// <param name="intraDistance">Distance between the edges of the edge pair.</param>
		// Token: 0x060009F9 RID: 2553 RVA: 0x0003F800 File Offset: 0x0003DA00
		public void FuzzyMeasurePairing(HImage image, double sigma, double ampThresh, double fuzzyThresh, string transition, string pairing, int numPairs, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple rowPairCenter, out HTuple columnPairCenter, out HTuple fuzzyScore, out HTuple intraDistance)
		{
			IntPtr proc = HalconAPI.PreCall(832);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, ampThresh);
			HalconAPI.StoreD(proc, 3, fuzzyThresh);
			HalconAPI.StoreS(proc, 4, transition);
			HalconAPI.StoreS(proc, 5, pairing);
			HalconAPI.StoreI(proc, 6, numPairs);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			HalconAPI.InitOCT(proc, 6);
			HalconAPI.InitOCT(proc, 7);
			HalconAPI.InitOCT(proc, 8);
			HalconAPI.InitOCT(proc, 9);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowEdgeFirst);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnEdgeFirst);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out amplitudeFirst);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out rowEdgeSecond);
			num = HTuple.LoadNew(proc, 4, HTupleType.DOUBLE, num, out columnEdgeSecond);
			num = HTuple.LoadNew(proc, 5, HTupleType.DOUBLE, num, out amplitudeSecond);
			num = HTuple.LoadNew(proc, 6, HTupleType.DOUBLE, num, out rowPairCenter);
			num = HTuple.LoadNew(proc, 7, HTupleType.DOUBLE, num, out columnPairCenter);
			num = HTuple.LoadNew(proc, 8, HTupleType.DOUBLE, num, out fuzzyScore);
			num = HTuple.LoadNew(proc, 9, HTupleType.DOUBLE, num, out intraDistance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Extract straight edge pairs perpendicular to a rectangle or an annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of Gaussian smoothing. Default: 1.0</param>
		/// <param name="ampThresh">Minimum edge amplitude. Default: 30.0</param>
		/// <param name="fuzzyThresh">Minimum fuzzy value. Default: 0.5</param>
		/// <param name="transition">Select the first gray value transition of the edge pairs. Default: "all"</param>
		/// <param name="rowEdgeFirst">Row coordinate of the first edge point.</param>
		/// <param name="columnEdgeFirst">Column coordinate of the first edge point.</param>
		/// <param name="amplitudeFirst">Edge amplitude of the first edge (with sign).</param>
		/// <param name="rowEdgeSecond">Row coordinate of the second edge point.</param>
		/// <param name="columnEdgeSecond">Column coordinate of the second edge point.</param>
		/// <param name="amplitudeSecond">Edge amplitude of the second edge (with sign).</param>
		/// <param name="rowEdgeCenter">Row coordinate of the center of the edge pair.</param>
		/// <param name="columnEdgeCenter">Column coordinate of the center of the edge pair.</param>
		/// <param name="fuzzyScore">Fuzzy evaluation of the edge pair.</param>
		/// <param name="intraDistance">Distance between edges of an edge pair.</param>
		/// <param name="interDistance">Distance between consecutive edge pairs.</param>
		// Token: 0x060009FA RID: 2554 RVA: 0x0003F940 File Offset: 0x0003DB40
		public void FuzzyMeasurePairs(HImage image, double sigma, double ampThresh, double fuzzyThresh, string transition, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple rowEdgeCenter, out HTuple columnEdgeCenter, out HTuple fuzzyScore, out HTuple intraDistance, out HTuple interDistance)
		{
			IntPtr proc = HalconAPI.PreCall(833);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, ampThresh);
			HalconAPI.StoreD(proc, 3, fuzzyThresh);
			HalconAPI.StoreS(proc, 4, transition);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			HalconAPI.InitOCT(proc, 6);
			HalconAPI.InitOCT(proc, 7);
			HalconAPI.InitOCT(proc, 8);
			HalconAPI.InitOCT(proc, 9);
			HalconAPI.InitOCT(proc, 10);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowEdgeFirst);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnEdgeFirst);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out amplitudeFirst);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out rowEdgeSecond);
			num = HTuple.LoadNew(proc, 4, HTupleType.DOUBLE, num, out columnEdgeSecond);
			num = HTuple.LoadNew(proc, 5, HTupleType.DOUBLE, num, out amplitudeSecond);
			num = HTuple.LoadNew(proc, 6, HTupleType.DOUBLE, num, out rowEdgeCenter);
			num = HTuple.LoadNew(proc, 7, HTupleType.DOUBLE, num, out columnEdgeCenter);
			num = HTuple.LoadNew(proc, 8, HTupleType.DOUBLE, num, out fuzzyScore);
			num = HTuple.LoadNew(proc, 9, HTupleType.DOUBLE, num, out intraDistance);
			num = HTuple.LoadNew(proc, 10, HTupleType.DOUBLE, num, out interDistance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Extract straight edges perpendicular to a rectangle or an annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of Gaussian smoothing. Default: 1.0</param>
		/// <param name="ampThresh">Minimum edge amplitude. Default: 30.0</param>
		/// <param name="fuzzyThresh">Minimum fuzzy value. Default: 0.5</param>
		/// <param name="transition">Select light/dark or dark/light edges. Default: "all"</param>
		/// <param name="rowEdge">Row coordinate of the edge point.</param>
		/// <param name="columnEdge">Column coordinate of the edge point.</param>
		/// <param name="amplitude">Edge amplitude of the edge (with sign).</param>
		/// <param name="fuzzyScore">Fuzzy evaluation of the edges.</param>
		/// <param name="distance">Distance between consecutive edges.</param>
		// Token: 0x060009FB RID: 2555 RVA: 0x0003FA84 File Offset: 0x0003DC84
		public void FuzzyMeasurePos(HImage image, double sigma, double ampThresh, double fuzzyThresh, string transition, out HTuple rowEdge, out HTuple columnEdge, out HTuple amplitude, out HTuple fuzzyScore, out HTuple distance)
		{
			IntPtr proc = HalconAPI.PreCall(834);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, ampThresh);
			HalconAPI.StoreD(proc, 3, fuzzyThresh);
			HalconAPI.StoreS(proc, 4, transition);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowEdge);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnEdge);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out amplitude);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out fuzzyScore);
			num = HTuple.LoadNew(proc, 4, HTupleType.DOUBLE, num, out distance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Extract straight edge pairs perpendicular to a rectangle or annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of gaussian smoothing. Default: 1.0</param>
		/// <param name="threshold">Minimum edge amplitude. Default: 30.0</param>
		/// <param name="transition">Type of gray value transition that determines how edges are grouped to edge pairs. Default: "all"</param>
		/// <param name="select">Selection of edge pairs. Default: "all"</param>
		/// <param name="rowEdgeFirst">Row coordinate of the center of the first edge.</param>
		/// <param name="columnEdgeFirst">Column coordinate of the center of the first edge.</param>
		/// <param name="amplitudeFirst">Edge amplitude of the first edge (with sign).</param>
		/// <param name="rowEdgeSecond">Row coordinate of the center of the second edge.</param>
		/// <param name="columnEdgeSecond">Column coordinate of the center of the second edge.</param>
		/// <param name="amplitudeSecond">Edge amplitude of the second edge (with sign).</param>
		/// <param name="intraDistance">Distance between edges of an edge pair.</param>
		/// <param name="interDistance">Distance between consecutive edge pairs.</param>
		// Token: 0x060009FC RID: 2556 RVA: 0x0003FB4C File Offset: 0x0003DD4C
		public void MeasurePairs(HImage image, double sigma, double threshold, string transition, string select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)
		{
			IntPtr proc = HalconAPI.PreCall(835);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, threshold);
			HalconAPI.StoreS(proc, 3, transition);
			HalconAPI.StoreS(proc, 4, select);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			HalconAPI.InitOCT(proc, 6);
			HalconAPI.InitOCT(proc, 7);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowEdgeFirst);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnEdgeFirst);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out amplitudeFirst);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out rowEdgeSecond);
			num = HTuple.LoadNew(proc, 4, HTupleType.DOUBLE, num, out columnEdgeSecond);
			num = HTuple.LoadNew(proc, 5, HTupleType.DOUBLE, num, out amplitudeSecond);
			num = HTuple.LoadNew(proc, 6, HTupleType.DOUBLE, num, out intraDistance);
			num = HTuple.LoadNew(proc, 7, HTupleType.DOUBLE, num, out interDistance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Extract straight edges perpendicular to a rectangle or annular arc.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="image">Input image.</param>
		/// <param name="sigma">Sigma of gaussian smoothing. Default: 1.0</param>
		/// <param name="threshold">Minimum edge amplitude. Default: 30.0</param>
		/// <param name="transition">Light/dark or dark/light edge. Default: "all"</param>
		/// <param name="select">Selection of end points. Default: "all"</param>
		/// <param name="rowEdge">Row coordinate of the center of the edge.</param>
		/// <param name="columnEdge">Column coordinate of the center of the edge.</param>
		/// <param name="amplitude">Edge amplitude of the edge (with sign).</param>
		/// <param name="distance">Distance between consecutive edges.</param>
		// Token: 0x060009FD RID: 2557 RVA: 0x0003FC50 File Offset: 0x0003DE50
		public void MeasurePos(HImage image, double sigma, double threshold, string transition, string select, out HTuple rowEdge, out HTuple columnEdge, out HTuple amplitude, out HTuple distance)
		{
			IntPtr proc = HalconAPI.PreCall(836);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.StoreD(proc, 1, sigma);
			HalconAPI.StoreD(proc, 2, threshold);
			HalconAPI.StoreS(proc, 3, transition);
			HalconAPI.StoreS(proc, 4, select);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			int num = HalconAPI.CallProcedure(proc);
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out rowEdge);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out columnEdge);
			num = HTuple.LoadNew(proc, 2, HTupleType.DOUBLE, num, out amplitude);
			num = HTuple.LoadNew(proc, 3, HTupleType.DOUBLE, num, out distance);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
		}

		/// <summary>
		///   Translate a measure object.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the new reference point. Default: 50.0</param>
		/// <param name="column">Column coordinate of the new reference point. Default: 100.0</param>
		// Token: 0x060009FE RID: 2558 RVA: 0x0003FD04 File Offset: 0x0003DF04
		public void TranslateMeasure(HTuple row, HTuple column)
		{
			IntPtr proc = HalconAPI.PreCall(837);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, row);
			HalconAPI.Store(proc, 2, column);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Translate a measure object.
		///   Instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the new reference point. Default: 50.0</param>
		/// <param name="column">Column coordinate of the new reference point. Default: 100.0</param>
		// Token: 0x060009FF RID: 2559 RVA: 0x0003FD54 File Offset: 0x0003DF54
		public void TranslateMeasure(double row, double column)
		{
			IntPtr proc = HalconAPI.PreCall(837);
			base.Store(proc, 0);
			HalconAPI.StoreD(proc, 1, row);
			HalconAPI.StoreD(proc, 2, column);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to an annular arc.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="centerRow">Row coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="centerCol">Column coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="radius">Radius of the arc. Default: 50.0</param>
		/// <param name="angleStart">Start angle of the arc in radians. Default: 0.0</param>
		/// <param name="angleExtent">Angular extent of the arc in radians. Default: 6.28318</param>
		/// <param name="annulusRadius">Radius (half width) of the annulus. Default: 10.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x06000A00 RID: 2560 RVA: 0x0003FD98 File Offset: 0x0003DF98
		public void GenMeasureArc(HTuple centerRow, HTuple centerCol, HTuple radius, HTuple angleStart, HTuple angleExtent, HTuple annulusRadius, int width, int height, string interpolation)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(838);
			HalconAPI.Store(proc, 0, centerRow);
			HalconAPI.Store(proc, 1, centerCol);
			HalconAPI.Store(proc, 2, radius);
			HalconAPI.Store(proc, 3, angleStart);
			HalconAPI.Store(proc, 4, angleExtent);
			HalconAPI.Store(proc, 5, annulusRadius);
			HalconAPI.StoreI(proc, 6, width);
			HalconAPI.StoreI(proc, 7, height);
			HalconAPI.StoreS(proc, 8, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(centerRow);
			HalconAPI.UnpinTuple(centerCol);
			HalconAPI.UnpinTuple(radius);
			HalconAPI.UnpinTuple(angleStart);
			HalconAPI.UnpinTuple(angleExtent);
			HalconAPI.UnpinTuple(annulusRadius);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to an annular arc.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="centerRow">Row coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="centerCol">Column coordinate of the center of the arc. Default: 100.0</param>
		/// <param name="radius">Radius of the arc. Default: 50.0</param>
		/// <param name="angleStart">Start angle of the arc in radians. Default: 0.0</param>
		/// <param name="angleExtent">Angular extent of the arc in radians. Default: 6.28318</param>
		/// <param name="annulusRadius">Radius (half width) of the annulus. Default: 10.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x06000A01 RID: 2561 RVA: 0x0003FE54 File Offset: 0x0003E054
		public void GenMeasureArc(double centerRow, double centerCol, double radius, double angleStart, double angleExtent, double annulusRadius, int width, int height, string interpolation)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(838);
			HalconAPI.StoreD(proc, 0, centerRow);
			HalconAPI.StoreD(proc, 1, centerCol);
			HalconAPI.StoreD(proc, 2, radius);
			HalconAPI.StoreD(proc, 3, angleStart);
			HalconAPI.StoreD(proc, 4, angleExtent);
			HalconAPI.StoreD(proc, 5, annulusRadius);
			HalconAPI.StoreI(proc, 6, width);
			HalconAPI.StoreI(proc, 7, height);
			HalconAPI.StoreS(proc, 8, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to a rectangle.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the center of the rectangle. Default: 300.0</param>
		/// <param name="column">Column coordinate of the center of the rectangle. Default: 200.0</param>
		/// <param name="phi">Angle of longitudinal axis of the rectangle to horizontal (radians). Default: 0.0</param>
		/// <param name="length1">Half width of the rectangle. Default: 100.0</param>
		/// <param name="length2">Half height of the rectangle. Default: 20.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x06000A02 RID: 2562 RVA: 0x0003FEE8 File Offset: 0x0003E0E8
		public void GenMeasureRectangle2(HTuple row, HTuple column, HTuple phi, HTuple length1, HTuple length2, int width, int height, string interpolation)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(839);
			HalconAPI.Store(proc, 0, row);
			HalconAPI.Store(proc, 1, column);
			HalconAPI.Store(proc, 2, phi);
			HalconAPI.Store(proc, 3, length1);
			HalconAPI.Store(proc, 4, length2);
			HalconAPI.StoreI(proc, 5, width);
			HalconAPI.StoreI(proc, 6, height);
			HalconAPI.StoreS(proc, 7, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(row);
			HalconAPI.UnpinTuple(column);
			HalconAPI.UnpinTuple(phi);
			HalconAPI.UnpinTuple(length1);
			HalconAPI.UnpinTuple(length2);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Prepare the extraction of straight edges perpendicular to a rectangle.
		///   Modified instance represents: Measure object handle.
		/// </summary>
		/// <param name="row">Row coordinate of the center of the rectangle. Default: 300.0</param>
		/// <param name="column">Column coordinate of the center of the rectangle. Default: 200.0</param>
		/// <param name="phi">Angle of longitudinal axis of the rectangle to horizontal (radians). Default: 0.0</param>
		/// <param name="length1">Half width of the rectangle. Default: 100.0</param>
		/// <param name="length2">Half height of the rectangle. Default: 20.0</param>
		/// <param name="width">Width of the image to be processed subsequently. Default: 512</param>
		/// <param name="height">Height of the image to be processed subsequently. Default: 512</param>
		/// <param name="interpolation">Type of interpolation to be used. Default: "nearest_neighbor"</param>
		// Token: 0x06000A03 RID: 2563 RVA: 0x0003FF94 File Offset: 0x0003E194
		public void GenMeasureRectangle2(double row, double column, double phi, double length1, double length2, int width, int height, string interpolation)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(839);
			HalconAPI.StoreD(proc, 0, row);
			HalconAPI.StoreD(proc, 1, column);
			HalconAPI.StoreD(proc, 2, phi);
			HalconAPI.StoreD(proc, 3, length1);
			HalconAPI.StoreD(proc, 4, length2);
			HalconAPI.StoreI(proc, 5, width);
			HalconAPI.StoreI(proc, 6, height);
			HalconAPI.StoreS(proc, 7, interpolation);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}
	}
}
